# $Id$
# Maintainer: Jan de Groot <jgc@archlinux.org>
# Contributor: Andrea Scarpino <andrea@archlinux.org>
# Contributor: Thomas Baechler <thomas@archlinux.org>

pkgbase=thunderbird-i18n
pkgver=52.3.0
pkgrel=1
pkgdesc="Language pack for Thunderbird"
arch=('any')
url="http://www.mozilla.com/"
license=('MPL' 'GPL')

_languages=(
  'ar     "Arabic"'
  'ast    "Asturian"'
  'be     "Belarusian"'
  'bg     "Bulgarian"'
  'bn-BD  "Bengali (Bangladesh)"'
  'br     "Breton"'
  'ca     "Catalan"'
  'cs     "Czech"'
  'cy     "Welsh"'
  'da     "Danish"'
  'de     "German"'
  'dsb    "Lower Sorbian"'
  'el     "Greek"'
  'en-GB  "English (British)"'
  'en-US  "English (US)"'
  'es-AR  "Spanish (Argentina)"'
  'es-ES  "Spanish (Spain)"'
  'et     "Estonian"'
  'eu     "Basque"'
  'fi     "Finnish"'
  'fr     "French"'
  'fy-NL  "Frisian"'
  'ga-IE  "Irish"'
  'gd     "Gaelic (Scotland)"'
  'gl     "Galician"'
  'he     "Hebrew"'
  'hr     "Croatian"'
  'hsb    "Upper Sorbian"'
  'hu     "Hungarian"'
  'hy-AM  "Armenian"'
  'id     "Indonesian"'
  'is     "Icelandic"'
  'it     "Italian"'
  'ja     "Japanese"'
  'ko     "Korean"'
  'lt     "Lithuanian"'
  'nb-NO  "Norwegian (Bokmål)"'
  'nl     "Dutch"'
  'nn-NO  "Norwegian (Nynorsk)"'
  'pa-IN  "Punjabi (India)"'
  'pl     "Polish"'
  'pt-BR  "Portuguese (Brazilian)"'
  'pt-PT  "Portuguese (Portugal)"'
  'rm     "Romansh"'
  'ro     "Romanian"'
  'ru     "Russian"'
  'si     "Sinhala"'
  'sk     "Slovak"'
  'sl     "Slovenian"'
  'sq     "Albanian"'
  'sr     "Serbian"'
  'sv-SE  "Swedish"'
  'ta-LK  "Tamil (Sri Lanka)"'
  'tr     "Turkish"'
  'uk     "Ukrainian"'
  'vi     "Vietnamese"'
  'zh-CN  "Chinese (Simplified)"'
  'zh-TW  "Chinese (Traditional)"'
)

pkgname=()
source=()
_url=https://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/$pkgver/linux-i686/xpi

for _lang in "${_languages[@]}"; do
  _locale=${_lang%% *}
  _pkgname=thunderbird-i18n-${_locale,,}

  pkgname+=($_pkgname)
  source+=("thunderbird-i18n-$pkgver-$_locale.xpi::$_url/$_locale.xpi")
  eval "package_$_pkgname() {
    _package $_lang
  }"
done

# Don't extract anything
noextract=(${source[@]%%::*})

_package() {
  pkgdesc="$2 language pack for Thunderbird"
  depends=("thunderbird>=$pkgver")
  install -Dm644 thunderbird-i18n-$pkgver-$1.xpi \
    "$pkgdir/usr/lib/thunderbird/extensions/langpack-$1@thunderbird.mozilla.org.xpi"
}

sha256sums=('a96dbaed8c14e113c2e2295422c4346ed97cbba349f6464532d4585ab6a5be88'
            'eb2614092cebafb0d326ac318bbd76d5e35a6865fe4f0be72bad871bc703584f'
            'b412a5cb7f2752d1d72325356b9d0fa124af03f29e45ceeafe3b0b9fc0c7e28b'
            'ff093e353378ae63727aca8b95578d89d369c6b86e48a030d893a9cd8ad77922'
            'eaebfde95c33aafa0c7aa649fca093a25ed93db58e8fed3485589b9326806270'
            '87819d6762d57ce02564ec3cdb195158eed635ba27a3165dfc862553f53f188a'
            '9dffc936fd1dda855d19eb464ce01b22bfb667585b983b3c7b0a74ea10e298ce'
            'eb0412f1fcf7a7c96e434d114d5763c56322317633bb8790dfa3362df03be870'
            '1a000f677941f4c28186d4e58bf6df79f4d8a47e2a7a338005bad91604e8c388'
            '583fd8b1d6034739477cc5d935a766242b7d1e4bdb869545645f893d4d80cd70'
            '48cf4ae0856b286f4f5788abcfec66b8817dbd836102236907e826cb2ed555b3'
            '7e4333f45af142b59c401b303cd4111bd5e92a4f3a4aaf0a9287a224283087b3'
            '554a62ec5d5ae4cca3d093273b8df7357b649f0b853a05714a7990667d1e8e7c'
            '2cf73f099a49cba6301ac60da05e6bafa495e9363d6c0bf84caecc1a928bde8e'
            'fb145187f2917838897130f23159e6a643cd134aaea1278f0e968436cdf6c30c'
            'f4b32effba6b458346067eb3ccf1c0de6d30cc4170d0918b013e43cac476037f'
            'ba01837ab8f6e520fab791c65b9897e7194e2297a073c9c1388e45f02f2cd9a4'
            '1fab98e403dae9cc5a890b5f36759e6c9c10c88d150f5c0d1fa97dc5f822b0df'
            '891ca411246628ac63e41cc5e1316afcf9ace1c62eaf69e2a23777f24f4b2c29'
            '83944d311d4230f8e17682f1a1248cab3713e7825b87ab0511d5293772c053bf'
            'e9a81424c9af8e0fe21abc94deb53a20f83d6ec7f4484ae4ab2816cd4aa9022f'
            '671f0d00c544b500b420375c385e8232354fe364f4e78dbf027ba319745ed61b'
            '5fbc249bff62b9cd732fd3ed26af3308ac25bb7ca71e5522e1b9213e22ff8e21'
            'fc384ea05422569d075e13c8e4063fc613f37cec50e99a63deb8c0b88c12af8a'
            'c4d9c4c7ab51985e265b7f4aaa9af7f7f798923dc9cc2796409cd912a437526e'
            'd9d6cc59c40257d7b4f47ffec7e0f8b7025f219ac08a45e5b30f645c68ebce9e'
            'a72bfb410e1a492a1f43cfa44b851b659d275a49ea930063c977501799f3367e'
            'd9972fe797d7b30b642ef8950dbccc81f8ef4f7230df6d9f49983528edbcac84'
            'a10bb179def63b0795e871268396e8091583adaff141b06ae1ea84caf014814d'
            'b78d7432de20a474bcdbb847a35c60622ec48af5a9d17692b3d5d4b06514b9b5'
            '06de6a7000509f8f1a9aaf1438a5ff1133a00b513a6ef868c861256463e7fff2'
            '8dafb8e5fd1c967ce613893c12e553aca11d82a5880822e010941f7d02e3e457'
            '3987ec1092b72806eddad880b5ee25d1fd930be2ade91c8277fca50de21f8322'
            '7024ed0f72065e103dc72c388162f4dba5102bcb96b2fb6384b46503fdc28057'
            '816fbb26a0a21a88633b1ffd236a73c5fb31da5a21a28d3bfb9d4cb5f9c2b7c8'
            'a8505ea9138478c30e839fffe1949d63e536f2a812c2777a315a59f30bd1ddb2'
            'c1c15dc37d85a4912ab467e9bf9aef814ae432eff338032b41c1fd49eae13010'
            'c713a6dbeebb1c8dd77634dfba6b7dda3b422fb28a55329e2d8afa8ce60484ce'
            'a0b5cc0aa1c7017e8030fbc8c4b6573ddd3db4d6f15c97e9aa2eeeacba9c95e5'
            'bcb38080fe3aed04631029947050f12a5c5abf3a9a8710d36ef10f2186108c52'
            'b67d804febd8b5c2ac18fd1eb16e958113b8b240d69ce4b80bcd14f9b3afd220'
            '01e6248cfd1939ef66a8f7f1ad682a5735392b6ee41fdefe92e7cfa5aafed5a6'
            'f02da1da4e3d5edc7b1f903470c7bf02f06026d0acfce6d064a15233a21c0e00'
            '3df2eb933ed20ccd66c8da61bdb74670e7b5e5a2def1c8a9a45fc2a25c55a03c'
            '4bbeb7ea8eedfc8e0a5bf2517d38fdd9aab6a29a7d88cb68c454e3fdf80d3413'
            '0692791c71ff37b7b1c141f68ffb985d2a565edd4085b2dc3456ef3a3c45e2e3'
            '09af36243360b498a6352f10eb28c78f855d87ce0ef5fbfbc11f13bb45465462'
            '6450c19ddad79bab8b059a992b844fd362d4e6cdd58e31d63bafe25f7e73ab31'
            '190ed15658855a1438b46614209d723bf27fb90864ca64dc21482fb52f5718b4'
            'a68c843f7d755ab2b03a8c23018f17be1664279659f9fa9bcbae207ad27d309c'
            '194e63cc0eac946214adeb1a45b046a07ce5f7dbe3d16c1dc960dae07f3215ef'
            'ab9811adb9abf588119d7854ba79a6fb6204eeef3724a0a615a3815fbe8ebfd8'
            '62d4a70fc6b8c93a44e9de6d810a3c62561eead83b8abfb545b0bb22f500fec3'
            '4ef6bcf07c756a4da0c3aabe41c8d32962b72fb224ff93ea475d2f1270ceb061'
            'b6eaa27d994bb265b621f5df1b288d4d97e0f543e1806d9fd988c7a563f683a1'
            '98fa9c475af8c5a4dfe132ef5f27bf3ae0b550cce46c6bf7125608beb965aa06'
            '2c5beb3ba1bebc339ae4124fcee79fad375ebba7d97251dac83ff1eed1042bad'
            '2279205d7288313d59be7c2eadcc572988e063fbb570e76802cb681bdc262e0e')
